//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package test.集合.斗地主2;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.TreeMap;
import java.util.TreeSet;

public class PokerGame {
    private static HashMap<Integer, String> map = new HashMap();
    private static List<Integer> sequence = new ArrayList();
    private static final int n = 54;

    public PokerGame() {
        Collections.shuffle(sequence);
        TreeSet<Integer> bottomCard = new TreeSet();
        TreeSet<Integer> player1 = new TreeSet();
        TreeSet<Integer> player2 = new TreeSet();
        TreeSet<Integer> player3 = new TreeSet();
        int i = 0;

        while(i < 51) {
            player1.add((Integer)sequence.get(i++));
            player2.add((Integer)sequence.get(i++));
            player3.add((Integer)sequence.get(i++));
        }

        Collections.addAll(bottomCard, new Integer[]{(Integer)sequence.get(53), (Integer)sequence.get(52), (Integer)sequence.get(51)});
        LookCords("玩家1：", player1);
        LookCords("玩家1：", player2);
        LookCords("玩家1：", player3);
        LookCords("底牌 ：", bottomCard);
    }

    public static TreeMap<Integer, String> LookCords(String name, TreeSet<Integer> cords) {
        TreeMap<Integer, String> treeMap = new TreeMap();

        for(Integer i : cords) {
            treeMap.put(i, (String)map.get(i));
        }

        System.out.print(name + " ");
        System.out.println(treeMap);
        return treeMap;
    }

    static {
        String[] colors = new String[]{"♥", "♦", "♠", "♣"};
        String[] nums = new String[]{"3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A", "2"};
        int sequenceNumber = 1;

        for(String num : nums) {
            for(String color : colors) {
                sequence.add(sequenceNumber);
                map.put(sequenceNumber++, color + num);
            }
        }

        sequence.add(sequenceNumber);
        map.put(sequenceNumber++, "小王");
        sequence.add(sequenceNumber);
        map.put(sequenceNumber, "大王");
    }
}
